package com.jctrip.hotel.source.model.greentree.req;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * @Author：Haruhi
 * @description:
 * @Date：2023/8/30 23:09
 * @Package：com.jctrip.hotel.source.model.greentree.req
 * @Project：hotel-main
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JacksonXmlRootElement(localName = "CreateBooking")
public class CreateBookingReq extends GreenTreeBaseReq{
    
//    @JacksonXmlProperty(isAttribute = true)
//    private String systemType;
    
    @JacksonXmlProperty(localName = "ReservationInfo")
    private ReservationInfo reservationInfo;
    
    @JacksonXmlProperty(localName = "CustomInfos")
    private CustomInfos customInfos;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ReservationInfo {
        @JacksonXmlProperty(localName = "KeepTime")
        private String keepTime;
        
        @JacksonXmlProperty(localName = "StartDate")
        private String startDate;
        
        @JacksonXmlProperty(localName = "EndDate")
        private String endDate;
        
        @JacksonXmlProperty(localName = "HotelCode")
        private String hotelCode;
        
        @JacksonXmlProperty(localName = "ReqRooms")
        private ReqRooms reqRooms;
        
        @JacksonXmlProperty(localName = "Guarantee")
        private Guarantee guarantee;

        /**
         * |费用总计:XXX|含早情况：XXX,房费由大唐商旅支付,杂费客人自理，渠道开具发票，
         * 大唐商旅订单号:XXXX 大唐商旅客服电话：XXXXX （请报大唐订单号），价格保密
         */
        @JacksonXmlProperty(localName = "Comment")
        private String comment;
        
        @JacksonXmlProperty(localName = "AgentUniqueID")
        private String agentUniqueID;

        // getter 和 setter 方法省略
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class ReqRooms {
        @JacksonXmlProperty(localName = "ReqRoom")
        private ReqRoom reqRoom;

        // getter 和 setter 方法省略
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class ReqRoom {
        @JacksonXmlProperty(localName = "roomTypeCode",isAttribute = true)
        private String roomTypeCode;

        @JacksonXmlProperty(localName = "RoomCount")
        private Integer roomCount;

        @JacksonXmlProperty(localName = "RoomRate")
        private RoomRate roomRate;

        // getter 和 setter 方法省略
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class RoomRate {
        @JacksonXmlProperty(localName = "currencyCode" ,isAttribute = true)
        private String currencyCode;

        /**
         * 房价
         */
        @JacksonXmlText
        private BigDecimal roomRate;

    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class Guarantee {
        @JacksonXmlProperty(localName = "guaranteeType",isAttribute = true)
        private String guaranteeType;

        // getter 和 setter 方法省略
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class CustomInfos {
        @JacksonXmlProperty(localName = "CustomInfo")
        private CustomInfo customInfo;

        // getter 和 setter 方法省略
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class CustomInfo {
        @JacksonXmlProperty(localName = "FirstName")
        private String firstName;

        @JacksonXmlProperty(localName = "LastName")
        private String lastName;

        @JacksonXmlProperty(localName = "Gender")
        private String gender;

        @JacksonXmlProperty(localName = "NameTitle")
        private String nameTitle;

        @JacksonXmlProperty(localName = "ContactEmail")
        private String contactEmail;

        @JacksonXmlProperty(localName = "ContactPhone")
        private String contactPhone;

        // getter 和 setter 方法省略
    }
}

